module AltaBikes
  class Station

    attr_reader :details, :stats

    def initialize(station_hash)
      parse_station_hash(station_hash)
    end

    def parse_station_hash(station_hash)
      @details = {
        id:        station_hash['id'],
        location:  station_hash['location'],
        name:      station_hash['stationName'],
        longitude: station_hash['longitude'],
        latitude:  station_hash['latitude']

      }
      @stats = {
        available_docks: station_hash['availableDocks'],
        total_docks:     station_hash['totalDocks'],
        available_bikes: station_hash['availableBikes']
      }
    end
    private :parse_station_hash
  end
end
